Update the orientation of the previewLayer connection#165
Closed
ralfebert wants to merge 1 commit intotwostraws:mainfrom
Closed
Update the orientation of the previewLayer connection#165ralfebert wants to merge 1 commit intotwostraws:mainfrom
ralfebert wants to merge 1 commit intotwostraws:mainfrom
Conversation
Contributor
Author
|
Turns out this is a bad idea, I overlooked that |
…peared - When the permission prompt appears, updateOrientation was called before the AV connection was established and not updated afterwards - Update previewLayer.connection instead of captureSession?.connections.last - Remove implicit forced unwrap for previewLayer property
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I was seeing the CodeScanner appearing not correctly rotated on iPad in landscape mode in a sheet (both on my test device and on a device of a user).
I found the code in CodeScannerController#updateOrientation and saw the orientation being set correctly to landscapeRight.
For some strange reason, it then started work on my test device (without a code change).
I guess the updateOrientation routine is flaky in some kind and saw that captureSession?.connections.count was 3 and wondered if the last connection is always the correct one to update.
I don't know a lot about AVCaptureSession, but on first sight it seems a better choice to update previewLayer.connection instead.